#include "DeclarationSpecifiers.h"
#include "StorageClassSpecifier.h"
#include "TypeSpecifier.h"
#include "TypeQualifier.h"
#include "FunctionSpecifier.h"


DeclarationSpecifiers::~DeclarationSpecifiers( void )
{
	if(m_pDeclarationSpecs)
		delete m_pDeclarationSpecs;
	switch(m_iType)
	{
	case storage_class_specifier:
		delete m_pStorageSpecs;
		break;
	case type_qualifier:
		delete m_pTypeQuals;
		break;
	case type_specifier:
		delete m_pTypeSpecs;
		break;
	case function_specifier:
		delete m_pFuncSpecs;
		break;
	default:
		assert(0);
	}
}

void DeclarationSpecifiers::codeGen()
{
	COUT
	switch(m_iType)
	{
	case storage_class_specifier:
		m_pStorageSpecs->codeGen();
		break;
	case type_qualifier:
		m_pTypeQuals->codeGen();
		break;
	case type_specifier:
		m_pTypeSpecs->codeGen();
		break;
	case function_specifier:
		m_pFuncSpecs->codeGen();
		break;
	default:
		assert(0);
	}
	if(m_pDeclarationSpecs)
		m_pDeclarationSpecs->codeGen();
}